package com.aysafety.eventmodel.corn;

import com.aysafety.eventmodel.common.DateUtils;
import com.aysafety.eventmodel.service.gas.GasService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;

/**
 * @program: iotDataPlatform
 * @description: 瓦斯定时任务
 * @author: ChengQi
 * @create: 2019-01-24 02:22
 **/
//@Component
@Order(3)
public class GasTask {
    private static final Logger logger = LoggerFactory.getLogger(GasTask.class);

    @Autowired
    GasService gasService;

//    @Scheduled(cron = "0 0/1 * * * ? ")
    public void gasWarning() {
        logger.info("正在计算瓦斯特征参...");
        String currentTime = DateUtils.getTime();
        try {
            gasService.gasWarning(currentTime);
        } catch (Throwable throwable) {
            logger.error("gasWarning error,currentTime:"+currentTime);
        }
        logger.info("瓦斯特征参计算完成...currentTime:"+currentTime);
    }

}
